using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
	[Table("bgm_request"), DataContract]
    public class Request
    {
        public Request()
        {
            //this.RequestActivityPlans = new HashSet<RequestActivityPlan>();
            //this.RequestCustomsFields = new HashSet<RequestCustomsField>();
            //this.RequestExpenses = new HashSet<RequestExpense>();
            //this.RequestKpis = new HashSet<RequestKpi>();
            //this.RequestManagers = new HashSet<RequestManager>();
            //this.RequestOptions = new HashSet<RequestOption>();
        }
    

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "ReqId", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_seq", TypeName="int")]
        public int ReqId { get; set; }

		[DataMember, Display(Name = "ReqCode", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_code", TypeName="ntext")]
        public string ReqCode { get; set; }

		[DataMember, Display(Name = "ReqName", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_name", TypeName="ntext")]
        public string ReqName { get; set; }

		[DataMember, Display(Name = "ReqDescr", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_descr", TypeName="ntext")]
        public string ReqDescr { get; set; }

		[DataMember, Display(Name = "ReqManager", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_manager", TypeName="int")]
        public Nullable<int> ReqManager { get; set; }

		[DataMember, Display(Name = "ReqScope", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_scope", TypeName="int")]
        public Nullable<int> ReqScope { get; set; }

		[DataMember, Display(Name = "ReqDate", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_date", TypeName="datetime2")]
        public Nullable<System.DateTime> ReqDate { get; set; }

		[DataMember, Display(Name = "ReqReason", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_reason", TypeName="ntext")]
        public string ReqReason { get; set; }

		[DataMember, Display(Name = "ReqObject", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_object", TypeName="ntext")]
        public string ReqObject { get; set; }

		[DataMember, Display(Name = "ReqTarget", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_target", TypeName="ntext")]
        public string ReqTarget { get; set; }

		[DataMember, Display(Name = "ReqPlan", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_plan", TypeName="ntext")]
        public string ReqPlan { get; set; }

		[DataMember, Display(Name = "ReqRemark", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_req_remark", TypeName="ntext")]
        public string ReqRemark { get; set; }

        [ForeignKey("StrategyDataList")]
		[DataMember, Display(Name = "StratListId", ResourceType = typeof(Resources.RequestResource))]
        [Column("bgm_strat_list_seq", TypeName="int")]
        public Nullable<int> StratListId { get; set; }

        [ForeignKey("ProjectType")]
		[DataMember, Display(Name = "PrjTypeId", ResourceType = typeof(Resources.RequestResource))]
		[Column("prj_type_seq", TypeName="int")]
        public Nullable<int> PrjTypeId { get; set; }

		[ForeignKey("JobSite")]
		[DataMember, Display(Name = "JobSiteId", ResourceType = typeof(Resources.RequestResource))]
		[Column("job_site_seq", TypeName="int")]
        public Nullable<int> JobSiteId { get; set; }

		[DataMember, Display(Name = "JobSiteSeqMain", ResourceType = typeof(Resources.RequestResource))]
		[Column("job_site_seq_main", TypeName="int")]
        public Nullable<int> JobSiteSeqMain { get; set; }

		[DataMember, Display(Name = "Year", ResourceType = typeof(Resources.RequestResource))]
		[Column("bgm_year", TypeName="int")]
        public Nullable<int> BgYear { get; set; }

		[DataMember, Display(Name = "DateStart", ResourceType = typeof(Resources.RequestResource))]
		[Column("date_start", TypeName="datetime2")]
        public Nullable<System.DateTime> DateStart { get; set; }

		[DataMember, Display(Name = "DateEnd", ResourceType = typeof(Resources.RequestResource))]
		[Column("date_end", TypeName="datetime2")]
        public Nullable<System.DateTime> DateEnd { get; set; }


        //[DataMember]
        //public virtual ICollection<RequestActivityPlan> RequestActivityPlans { get; set; }

        //[DataMember]
        //public virtual ICollection<RequestCustomsField> RequestCustomsFields { get; set; }

        //[DataMember]
        //public virtual ICollection<RequestExpense> RequestExpenses { get; set; }

        //[DataMember]
        //public virtual ICollection<RequestKpi> RequestKpis { get; set; }

        //[DataMember]
        //public virtual ICollection<RequestManager> RequestManagers { get; set; }

        //[DataMember]
        //public virtual ICollection<RequestOption> RequestOptions { get; set; }

        [DataMember]
        public virtual StrategyDataList StrategyDataList { get; set; }

        [DataMember]
        public virtual ProjectType ProjectType { get; set; }

        [DataMember]
		public virtual HRM.JobSite JobSite { get; set; }


        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}